﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;


namespace PersistentObject.Common.Criteria
{
    /// <summary>
    /// Represent an operand in the clause
    /// </summary>
    public abstract class Operand
    {
        static MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
        public Operand()
        {
            var noneCiphenGuid = Guid.NewGuid().ToString().Replace("-", "");
            string t2 = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(noneCiphenGuid)), 4, 8);
            t2 = t2.Replace("-", "");
            ParameterName = string.Format("P_{0}", t2);
        }

        public string ParameterName { get; internal set; }
    }
}
